package com.qf.cm.controller;

import com.qf.cm.pojo.Branch;
import com.qf.cm.service.BranchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @Description: 公用常量
 * @Data: 2022/9/7 20:34
 * @Pacakge: com.qf.cm.controller
 * @ClassName: BranchController
 * @Author: fan
 */
@Controller
@RequestMapping("/branch")
public class BranchController {
    @Autowired
    private BranchService branchService;
    @RequestMapping("findBranchByBname")
    public ModelAndView findBranchByBname(String bname){
        ModelAndView modelAndView = new ModelAndView();
        Branch branch = branchService.findBranchByBname(bname);
        modelAndView.setViewName("/pages/branch/branch");
        modelAndView.addObject("branch",branch);
        return modelAndView;
    }

}
